package snooker.scoreboard;


public class FrameState {

	private int playerId;
	private int frameId;
	private Type type;
	private int breakId;
	private Ball ball;
	private int score;
	private int player1Score;
	private int player2Score;
	private int reds;
	private long eventTime;
	
	public FrameState(int playerId, int frameId, Type type, int breakId,
			Ball ball, int score, int player1Score, int player2Score, int reds, long eventOffSet) {
		this.playerId = playerId;
		this.frameId = frameId;
		this.type = type;
		this.breakId = breakId;
		this.ball = ball;
		this.score = score;
		this.player1Score = player1Score;
		this.player2Score = player2Score;
		this.reds = reds;
		this.eventTime = eventOffSet;
	}

	public int getPlayerId() {
		return playerId;
	}

	public int getFrameId() {
		return frameId;
	}

	public Type getType() {
		return type;
	}

	public int getBreakId() {
		return breakId;
	}

	public Ball getBall() {
		return ball;
	}

	public int getScore() {
		return score;
	}

	public int getPlayer1Score() {
		return player1Score;
	}

	public int getPlayer2Score() {
		return player2Score;
	}
	
	public int getReds() {
		return reds;
	}
	
	public long getEventTime() {
		return eventTime;
	}
	
	public boolean isFoul() {
		return Type.Foul.equals(type);
	}
	
	public String getEventTimeString() {
		return Utils.getTimeString(eventTime);
	}

	@Override
	public String toString() {
		return
			"playerId=" + getPlayerId() + "; " +
			"frameId=" + getFrameId() + "; " +
			"breakId=" + getBreakId() + "; " +
			"type=" + getType() + "; " +
			"ball=" + getBall() + "; " +
			"score=" + getScore() + "; " +
			"p1Score=" + getPlayer1Score() + "; " +
			"p2Score=" + getPlayer2Score() + "; " +
//			"reds=" + getReds() + "; " +
			"eventTime=" + getEventTimeString() + "";
	}
	
}
